@extends('admin.container')

@section('c-head')
    <script type="text/javascript">
        var PAGE_DATA = {
            REST_API: {
                uploadimg : '/temp/image',
                preViewImg : 'temp',
            },
            @if(isset($merchant))
            DEFAULT : {
                name: "{{$merchant->name}}", //供应商名称
                val: "{{$merchant->column}}", //推荐栏目 val值
                img_url: "{{$merchant->logo}}", //图片地址
                description: "{{$merchant->description}}", //描述
                addr: "{{$merchant->addr}}", //链接地址
                sort: "{{$merchant->sort}}", //排序
            },
            @else
            DEFAULT : null,
            @endif

        };
    </script>
@stop
@section('c-body')
    <div class="comm-title">
                <span class="title-msg" id="page-nav">
                        推荐位
                    </span>
    </div>
    <div class="comm-body">
        <form id="main-form" style="margin-top: 20px;" method="post" action="{{ $form }}" enctype="multipart/form-data">
            <input type="hidden" value="{{ csrf_token() }}" name="_token">
            @if(isset($merchant))<input type="hidden" name="_method" value="PUT">@endif
            <div class="input-line">
                <div class="key-txt">
                    供应商名称:
                </div>
                <div class="right-val">
                    <input name="name" style="width:100%;" id="name" />
                </div>
            </div>
            <div class="input-line">
                <div class="key-txt">
                    推荐栏目:
                </div>
                <div class="right-val">
                    <select id="classify" name="column" style="width:100%;">
                        <option value="">
                            请选择
                        </option>
                        <option value="1">
                            热门企业
                        </option>
                        <option value="2">
                            招商加盟
                        </option>
                    </select>
                </div>
            </div>
            <div class="input-line" id="regist-elec-docs">
                <div class="key-txt">
                    推荐图片:
                </div>
                <div class="right-val">
                    <input style="width:100%;" id="demo" />
                </div>
                <button class="am-btn am-btn-primary am-btn-xs" id="sel-pic" style="margin-left:10px; margin-top: 3px;float: left;">
                    浏览
                </button>
                <input type="file" style="display: none" id="file" name="logo">
                        <span class="tips-comm">
                            图片建议尺寸：180x80像素，可上传gif，jpg，png格式。
                        </span>
            </div>
            <div class="input-line" style="height:80px;display: none" id="preview">
                <div class="key-txt">
                    <span style="visibility:hidden">预览图片</span>
                </div>
                <div class="right-val">
                    <img src="" style="width:180px; height:80px;" id="img_url" />
                </div>
            </div>
            <div class="input-line" style="height: 80px">
                <div class="key-txt">
                    推荐描述:
                </div>
                <div class="right-val" style="width: auto;">
                    <textarea style="width:300px; max-width:300px; height:80px; max-height:80px;" name="description" id="description"></textarea>
                </div>
            </div>
            <div class="input-line">
                <div class="key-txt">
                    链接地址:
                </div>
                <div class="right-val">
                    <input name="addr" style="width:100%;" id="addr" />
                </div>
            </div>
            <div class="input-line">
                <div class="key-txt">
                    排序:
                </div>
                <div class="right-val">
                    <input name="sort" style="width:100%;" id="sort" />
                </div>
            </div>
            <div class="input-line" style="height:40px;margin-top: 30px;">
                <div class="key-txt">
                </div>
                <div class="right-val">
                    <button id="submit-btn" type="button" class="am-btn am-btn-primary am-btn-lg">
                                <span style="display:block;">
                                    提交
                                </span>
                    </button>
                    <button id="cancel-btn" type="button" class="am-btn am-btn-default am-btn-lg">
                                <span style="display:block;">
                                    取消
                                </span>
                    </button>
                </div>
            </div>
        </form>
    </div>
    <script src="/assets/b2b/admin/js/libs/jquery.validate.min.js">
    </script>
    <script src="/assets/b2b/admin/js/libs/messages_zh.js">
    </script>
    <script src="/assets/b2b/admin/js/libs/jquery.ajaxfileupload.js"></script>
    <script src="/assets/b2b/admin/js/pages/22.js">
    </script>
@stop